import request from '@/utils/request'

export function getList(query) {
	return request({
		url: '/admin/admin',
		method: 'get',
		data: query
	})
}


export function getInfo(id) {
	return request({
		url: `/admin/admin/${id}`,
		method: 'get',
		params: { id }
	})
}

export function modify(data) {
	return request({
		url: '/admin/admin/modify',
		method: 'post',
		data
	})
}

export function save(data) {
	return request({
		url: '/admin/admin',
		method: 'post',
		data
		// id: 0,
        // username: '',
        // password: '',
        // status: 1,
	})
}

export function del(id) {
	return request({
		url: '/admin/admin/del',
		method: 'post',
		params: { id }
	})
}

export function change(id, field, value) {
	const data = {
		val: id,
		field: field,
		value: value
	}
	return request({
		url: '/admin/admin/change',
		method: 'post',
		data
	})
}

export function delAll(data) {
	return request({
		url: '/admin/admin/delall',
		method: 'post',
		data
	})
}

export function changeAll(data) {
	return request({
		url: '/admin/admin/changeall',
		method: 'post',
		data
	})
}


